import request from "@/utils/request";

interface bannerListParams {
  current?: number,
  pageSize?: number,
  status?: number
}
export const getBanner = (params:bannerListParams) => {
  return request({
    url: "/api/sms/banner/queryBannerList",
    method: "get",
    params
  })
}
interface updateBannerStatusParams {
  ids:Array<number>,
  status:number
}
export const updateBannerStatus = (data:updateBannerStatusParams) => {
  return request({
    url: "/api/sms/banner/updateBannerStatus",
    method: "post",
    data
  })
}
interface deleteBannerParams {
  ids:Array<number>
}
export const deleteBanner = (data:deleteBannerParams) => {
  return request({
    url: "/api/sms/banner/deleteBanner",
    method: "post",
    data
  })
}
interface addBannerParams {
  name?:string,
  pic?:string,
  status?:number,
  url?:string,
  sort?:number,
  subTitle?:string,
  button1?:string,
  button2?:string,
  Product?:number
}
export const addBanner = (data:addBannerParams) => {
  return request({
    url: "/api/sms/banner/addBanner",
    method: "post",
    data
  })
}
interface updateBannerParams {
  id?:number,
  name?:string,
  pic?:string,
  status?:number,
  url?:string,
  sort?:number,
  subTitle?:string,
  button1?:string,
  button2?:string,
  Product?:number
}
export const updateBanner = (data:updateBannerParams) => {
  return request({
    url: "/api/sms/banner/updateBanner",
    method: "post",
    data
  })
}
interface getProductListParams {
  current?: number,
  pageSize?: number,
  publishStatus?: number
  name?: string
}
export const getProductList = (params:getProductListParams) => {
  return request({
    url: "/api/product/queryProductList",
    method: "get",
    params
  })
}

export const uploadImg = (data: any) => {
  return request({
    url: "/api/picture/upload",
    method: "post",
    data
  })
}